<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/tagDeclare.jsp"%>
<%@include file="/headDeclare.jsp"%>
<html>
<head>
<style type="text/css">
fieldset,table,tr,td {
	margin: 0;
	padding: 0;
}

th {
	text-align: center;
}

td {
	text-align: left;
	width: auto;
}

form label {
	font-weight: bolder;
}

table {
	border-collapse: separate;
	border: 1px;
}

img,a {
	border: 0;
}

select {
	width: 80px;
}

.tr_right {
	width: auto;
}
</style>

<script type="text/javascript">

$(document).ready(function() { 
	$("#backupTable").tablesorter({theme:'green', widgets:['zebra']});
});


	function download(fileName){
		var url = "<%=basePath%>system/download.do?fileName="+ fileName + "&type=db";
		document.location.href = url;
	};
	
	function deleteFile(fileName){
		var url = "<%=basePath%>system/delete.do?fileName="+ fileName + "&type=db";
		document.location.href = url;
	}
	
	function backup(){
		$("#progressBar").mask("正在备份，请稍后...");//打开遮罩层
		setTimeout(backupSubmit, 300);
	}
	
	function backupSubmit(){
		document.backupForm.submit();
	}
	

	
</script>
</head>

<body id="progressBar">
	<div style="width: 100%;">
		<div>
			<table id="backupTable" class="tablesorter">
				<thead>
					<tr>
						<th>名称</th>
						<th>大小</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${backupFileInfos}" var="info" varStatus="status">
						<tr>
							<td>${info.fileName }</td>
							<td><fmt:formatNumber pattern="#,##0.00">
													${info.size}
													</fmt:formatNumber> M</td>
							<td>
								<a href="javascript:void(0)" onclick="download('${info.fileName }')" >下载</a>
								<a href="javascript:void(0)" onclick="deleteFile('${info.fileName }')" >删除</a>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div>
		<form action="system/dbbackup.do" name="backupForm" id="backupForm" method="post">
			<input type="button" value="备份" onclick="backup()" />
		</form>
		</div>
<!-- 		<hr /> -->
<!-- 		<div> -->
<!-- 			<div style="text-align: right;"> -->
<!-- 				<form id="pagerForm" method="post" name="pagerForm" action="wall/list.do"> -->
<%-- 					<jt:pager action="pagerForm" /> --%>
<!-- 				</form> -->
<!-- 			</div> -->
<!-- 		</div> -->
	</div>
</body>
</html>

